import _fetch from '@/Utils/Fetch';
import {
  userManagement
} from '@/Utils/Urls';

// 管理员根据某个状态获取用户该状态的订单
export const managerGetOrderThunk = (data) => () => new Promise((resolve, reject) => {
  _fetch({
    url: userManagement.managerGetOrder,
    data
  }).then(res => {
    if (res && res.status === 200) {
      resolve(res)
    } else {
      reject()
    }
  })
})

export const queryUserAndAllStuInfoThunk = (userId) => () => new Promise((resolve, reject) => {
  _fetch({
    url: userManagement.queryUserAndAllStuInfo,
    data: {
      userId: String(userId)
    },
  }).then(res => {
    if (res && res.status === 200) {
      resolve(res)
    } else {
      reject()
    }
  })
})